package com.shinewind.home.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shinewind.home.mapper.IUserInfoMappingMapper;
import com.shinewind.home.service.IUserInfoMappingService;
import com.shinewind.pojo.entity.UserInfoMapping;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
@DubboService
public class UserInfoMappingServiceImpl extends ServiceImpl<IUserInfoMappingMapper,UserInfoMapping> implements IUserInfoMappingService {
    @Override
    public Integer getMappingUidByStrUid(String uId) {
        UserInfoMapping userInfoMapping = this.lambdaQuery().eq(UserInfoMapping::getUId,uId).one();
        return userInfoMapping.getUIdMapping();
    }

    @Override
    public void deleteUserInfoByUid(String uId) {
        this.lambdaUpdate().eq(UserInfoMapping::getUId,uId).remove();
    }

    @Override
    public Long getCount(String uId) {
        return this.lambdaQuery().eq(UserInfoMapping::getUId,uId).count();
    }
}
